import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'

export const asyncRoutes: RouteRecordRaw[] = [
    {
        path: '/',
        name: 'home',
        meta: {
            title: 'home'
        },
        component: () => import('@/view/Home.vue'),
        children: [
            {
                path: 'One',
                name: 'One',
                component: () => import('@/components/DemoOne.vue')
            },
            {
                path: 'Two',
                name: 'Two',
                component: () => import('@/components/DemoTwo.vue')
            },
            {
                path: 'Three',
                name: 'Three',
                component: () => import('@/components/DemoThree.vue')
            },
            {
                path: 'Four',
                name: 'Four',
                component: () => import('@/components/DemoFour.vue')
            },
            {
                path: '/SOne',
                name: 'SOne',
                component: () => import('@/components/setting/Sone.vue'),
            },
            {
                path: '/STwo',
                name: 'STwo',
                component: () => import('@/components/setting/STwo.vue'),
            },
            {
                path: '/SThree',
                name: 'SThree',
                component: () => import('@/components/setting/SThree.vue'),
            },
            {
                path: '/SFour',
                name: 'SFour',
                component: () => import('@/components/setting/Sfour.vue'),
            },
        ]
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes: asyncRoutes,
    scrollBehavior: () => ({ left: 0, top: 0 })
})

export default router